package de.karlNet.sambamanager.view.beans;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Controller;

import de.karlNet.sambamanager.ldapController.commands.RemoveLdapObject;
import de.karlNet.sambamanager.view.beans.trees.SelectedNodeContainer;

@Controller
@Scope(value="session", proxyMode=ScopedProxyMode.TARGET_CLASS)
public class DeleteLdapObjectBean {
	@Autowired
	private RemoveLdapObject removeLdapObject;
	@Autowired
	private SelectedNodeContainer selectedNodeContainer;

	public void deleteNode() {
		this.selectedNodeContainer.selectedNode.setParent(null);
		this.removeLdapObject
				.removeObject(this.selectedNodeContainer.selectedNode
						.getLdapObject());
	}
	
	public void deleteNode(boolean b) {
		this.deleteNode();
	}
}
